package three;

import java.util.Arrays;
import java.util.Scanner;

public class palindromes {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入一个1至9999之间的数");
        int n = sc.nextInt();
        int x, y, r = 0;
        int count = 0;
        y = n;
        while(n != 0) {
            x = n % 10;
            r = r * 10 + x;
            n = n / 10;
            count++;
        }
        System.out.println(n + "是" + count + "位数");
        if(r == y)
            System.out.println(n + "是回文数");
        else
            System.out.println(n + "不是回文数");
    }
}
